package com.gitee.wsl.coroutines

import kotlin.coroutines.Continuation

class LogContinuation<T>(private val continuation: Continuation<T>) : Continuation<T> by continuation {
    override fun resumeWith(result: Result<T>) {
        println("before resumeWith: $result")
        continuation.resumeWith(result)
        println("after resumeWith.")
    }
}

fun <T> Continuation<T>.toLogContinuation() = LogContinuation(this)